﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace WebApplication3.Migrations
{
    public partial class l7 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Weightgram",
                table: "OrderEntities",
                newName: "WeightGram");

            migrationBuilder.CreateSequence(
                name: "ProductEntityId",
                incrementBy: 10);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedAt",
                table: "OrderEntities",
                nullable: false,
                defaultValue: new DateTime(2018, 11, 4, 7, 23, 16, 563, DateTimeKind.Local));

            migrationBuilder.AddColumn<int>(
                name: "Status",
                table: "OrderEntities",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdatedAt",
                table: "OrderEntities",
                nullable: false,
                defaultValue: new DateTime(2018, 11, 4, 7, 23, 16, 563, DateTimeKind.Local));

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreatedAt",
                table: "LoginSeesions",
                nullable: false,
                defaultValue: new DateTime(2018, 11, 4, 7, 23, 16, 559, DateTimeKind.Local),
                oldClrType: typeof(DateTime),
                oldDefaultValue: new DateTime(2018, 11, 3, 23, 51, 34, 101, DateTimeKind.Local));

            migrationBuilder.CreateTable(
                name: "Products",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false),
                    UserId = table.Column<int>(nullable: false),
                    OpenId = table.Column<string>(nullable: true),
                    ProductName = table.Column<string>(nullable: false),
                    CreatedAt = table.Column<DateTime>(nullable: false, defaultValue: new DateTime(2018, 11, 4, 7, 23, 16, 565, DateTimeKind.Local)),
                    UpdatedAt = table.Column<DateTime>(nullable: false, defaultValue: new DateTime(2018, 11, 4, 7, 23, 16, 565, DateTimeKind.Local))
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Products", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Products");

            migrationBuilder.DropSequence(
                name: "ProductEntityId");

            migrationBuilder.DropColumn(
                name: "CreatedAt",
                table: "OrderEntities");

            migrationBuilder.DropColumn(
                name: "Status",
                table: "OrderEntities");

            migrationBuilder.DropColumn(
                name: "UpdatedAt",
                table: "OrderEntities");

            migrationBuilder.RenameColumn(
                name: "WeightGram",
                table: "OrderEntities",
                newName: "Weightgram");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreatedAt",
                table: "LoginSeesions",
                nullable: false,
                defaultValue: new DateTime(2018, 11, 3, 23, 51, 34, 101, DateTimeKind.Local),
                oldClrType: typeof(DateTime),
                oldDefaultValue: new DateTime(2018, 11, 4, 7, 23, 16, 559, DateTimeKind.Local));
        }
    }
}
